import App from './App'
import utils from "@/utils/utils";
import apis from "@/apis/index.js";//全局API
import auth from "@/utils/auth.js";
import pay from "@/utils/pay.js";
import configIndex from "@/config/index.js";
import atlas from "@/utils/atlas.js";

// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
  ...App
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
import * as Pinia from 'pinia';

export function createApp() {
  const app = createSSRApp(App)
  app.use(Pinia.createPinia());

  // 挂载到全局的每一个Vue实例上
  app.config.globalProperties.$utils = utils
  app.config.globalProperties.$apis = apis
  app.config.globalProperties.$auth = auth
  app.config.globalProperties.$pay = pay
  app.config.globalProperties.$config = configIndex
  app.config.globalProperties.$atlas = atlas

  return {
    app, Pinia
  }
}
// #endif